package com.ants.dgsxpt.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by liushun on 2016/8/11.
 */
@Controller
public class CommonRequest {

    @Autowired
    private HttpServletRequest request;

    @RequestMapping(value = "/{page}", method = RequestMethod.GET)
    public String page(@PathVariable String page) {
        return page;
    }


    @RequestMapping(value = "/{project}/{page}", method = RequestMethod.GET)
    public String project_page(@PathVariable String project, @PathVariable String page) {
        return project + "/" + page;
    }

    @RequestMapping(value = "/{project}/{file}/{page}", method = RequestMethod.GET)
    public String project_file_page(@PathVariable String project, @PathVariable String file, @PathVariable String page) {
        return project + "/" + file + "/" + page;
    }

}
